﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows;

namespace Ingenious.Core.TestHarness
{
    public class DebugOutputBindingBehaviour
    {
        public static readonly DependencyProperty ResolveProperty = DependencyProperty.RegisterAttached("Resolve",
            typeof(object), typeof(DebugOutputBindingBehaviour),
            new FrameworkPropertyMetadata(OnResolvePropertyChanged));

        public static object GetResolve(DependencyObject d)
        {
            return d.GetValue(ResolveProperty);
        }

        public static void SetResolve(DependencyObject d, object value)
        {
            d.SetValue(ResolveProperty, value);
        }

        private static void OnResolvePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
        {
            Debug.WriteLine("Old Value: " + (args.OldValue != null ? args.OldValue : "<null>") + " New Value: " + (args.NewValue != null ? args.NewValue : "<null>"));
        }
    }
}
